import React from 'react';
import type { StoryObj } from '@storybook/react';
import Button from './Button';

const meta = {
  title: 'Button',
  component: Button,
  tags: ['autodocs'],
};

export default meta;
type Story = StoryObj<typeof meta>;

export const Primary: Story = {
  args: {
    children: 'Текст',
    variant: 'primary',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Secondary: Story = {
  args: {
    children: 'Текст',
    variant: 'secondary',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Success: Story = {
  args: {
    children: 'Текст',
    variant: 'success',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Danger: Story = {
  args: {
    children: 'Текст',
    variant: 'danger',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Dark: Story = {
  args: {
    children: 'Текст',
    variant: 'dark',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Into: Story = {
  args: {
    children: 'Текст',
    variant: 'info',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Link: Story = {
  args: {
    children: 'Текст',
    variant: 'link',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};

export const Warning: Story = {
  args: {
    children: 'Текст',
    variant: 'warning',
    iconPosition: 'right',
    icon: (
      <svg viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M2.50652 13.3934C2.43827 13.8077 2.82152 14.1316 3.15926 13.9468L7.00044 11.8414L10.8407 13.9468C11.1785 14.1316 11.5617 13.8077 11.4935 13.3943L10.7672 8.97998L13.8498 5.84796C14.1377 5.55491 13.9881 5.01922 13.6022 4.96136L9.31652 4.31181L7.40555 0.27358C7.33125 0.106499 7.17338 0 7 0C6.82662 0 6.66875 0.106499 6.59445 0.27358L4.68348 4.31274L0.397814 4.96229C0.0119465 5.02015 -0.137676 5.55584 0.150194 5.84889L3.23276 8.98092L2.50652 13.3952V13.3934ZM6.81682 10.3886L3.88747 12L4.439 8.63349C4.46524 8.47612 4.41669 8.31509 4.30947 8.20385L2 5.8472L5.22022 5.35715C5.35557 5.33527 5.47228 5.24371 5.53254 5.11213L7.0004 2L8.46746 5.11213C8.52772 5.24371 8.64443 5.33527 8.77978 5.35715L12 5.84635L9.69053 8.203C9.58293 8.31434 9.53433 8.47584 9.561 8.63349L10.1125 12L7.18318 10.3886C7.06825 10.3252 6.93175 10.3252 6.81682 10.3886Z" />
      </svg>
    ),
  },
};
